#include <stdio.h>

int main(void)
{
    char file[100] = {0};

    printf("please input rename path/filename:\n");
    scanf("%s", file);
    printf("file=%s\n", file);

    FILE *fp = fopen(file, "r+");
    if(fp == NULL)
    {
        perror("fopen fail");
        return -1;
    }
    else
    {
        printf("open file successfull!\n");
        fclose(fp);
        if(remove(file) != 0)
        {
            // printf("remove file fail!\n");
            perror("remove file fail");
            return -1;
        }
        else
        {
            printf("remove file success!\n");
            return 0;
        }
    }
}